/************************************************************************
 * 项目名称（软件名称）：忠旺机械物资管理系统(mms)                           *
 * 研发设计单位：忠旺机械设备制造有限公司机械设计院智能控制设计科设计与研发。   *
 * 版权所有：忠旺机械设备制造有限公司                                       *
 * 注：本项目的一切技术专利，使用规范归解释权由忠旺机械设备制造有限公司所有。   *
 * 软件版本：Ver 1.0.0                                                   *
 * 文件路径：com.zhongwang.mms.module.buy.model                          *
 * 创建时间：2020年08月11日 18时27分                                      *
 *======================================================================*/
package com.zhongwang.mms.module.buy.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

@Data
/**
 *@name: ShopPlanChangeModel
 *@description:  采购计划变更接收Model
 *@param:
 *@returnType:
 *@author: 徐一贺
 *@coddingDate: 2020/8/11 18:28
 *@version: v1.0
**/
public class ShopPlanChangeReceiveModel {
    private Integer sppId;

    private String sppTrackCode;

    private String sppMatCode;

    private String sppMatDesc;

    private Double sppNum;

    private String sppUnit;

    private String sppStandardNo;

    private String sppCategory;

    private String sppBrand;

    private String sppRemark;

    private String sppProjectName;

    private String sppProjectCode;

    private String sppPart;

    private String sppDesigner;

    private String sppTel;

    private Date sppCreateTime;

    private String sppCreateUser;

    private String sppTypeName;

    private Integer sppTypeId;

    private String sppBuyer;

    private Integer sppPayCycle;

    private String sppProgress;

    private Integer sppImportStatus;

    private Integer sppImportLogId;

    private Integer sppStatus;

    private Integer sppChangeStatus;

    private Integer sppSpcId;

    private Integer sppRpcId;

    private Integer sppIntegraFlag;

    private Integer sppOdaId;

    private Integer sppRetStatus;

    private Date sppPreDate;

    private Integer sppPreStatus;

    private String sppSapCode;

    private Integer sppWhiId;

    private String sppPlanner;

    private String sppSupplier;

    private Integer sppSteelCode;

    private Date sppVerifyDate;

    private Date sppPredictDate;

    private Date sppTenderStartDate;

    private Date sppTenderEndDate;

    private Date sppQuoteStartDate;

    private Date sppQuoteEndDate;

    private Date sppContractStartDate;

    private Date sppContractEndDate;

    private String sppRowNo;

    private Date sppPlanDate;

    private Integer sppReviewFlag;

    private String sppPlannerRemark;

    /** 主键自增 */
    private Integer id;
    /** 计划ID */
    private Integer planId;
    /** 项目编号 */
    private String proCode;
    /** 项目名称 */
    private String proName;
    /** 项目数量 */
    private Integer proNum;
    /** 项目单位 */
    private String proUnit;
    /** 物料类型 机械、流体、自动化、外观（包括油漆）、消耗品（包括气体）、维修备件、办公用品 */
    private String malType;
    /** 部分 */
    private String part;
    /** 变更前物料描述 */
    private String malDesc;
    /** 变更后物料描述 */
    private String afterMalDesc;
    /** 变更前数量 */
    private Double num;
    /** 变更后数量 */
    private Double afterNum;
    /** 变更前单位 */
    private String unit;
    /** 变更后单位 */
    private String afterUnit;
    /** 变更前型号/标准号 */
    private String standard;
    /** 变更后型号/标准号 */
    private String afterStandard;
    /** 变更前品牌 */
    private String brand;
    /** 变更后品牌 */
    private String afterBrand;
    /** 变更前备注 */
    private String remark;
    /** 变更后备注 */
    private String afterRemark;
    /** 变更前图号（外协） */
    private String diagram;
    /** 变更后图号（外协） */
    private String afterDiagram;
    /** 变更前外协类型（外协） */
    private String assistType;
    /** 变更后外协类型（外协） */
    private String afterAssistType;
    /** 变更前使用库存 0=否 1=是 */
    private Integer useStore;
    /** 变更后使用库存 0=否 1=是 */
    private Integer afterUseStore;
    /** 变更前url */
    private String url;
    /** 变更后url */
    private String afterUrl;
    /** 状态 0=删除 1=正常 */
    private Integer status;
    /** 提报计划类型 1=外购件，2=外协件，3=原材料 */
    private Integer reportType;
    /** 提报人名称 */
    private String postName;
    /** 提报人电话 */
    private String postTel;
    /** 提报人所在部门 */
    private String postDept;
    /** 附件 */
    private String extendUrl;
    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /** 接收标识 0=未接收 1=已接收 */
    private Integer recMark;
    /** 接收时间 */
    private Date recTime;
    /** 变更标识 0=未变更 1=已变更 */
    private Integer changeMark;
    /** 变更时间 */
    private Date changeTime;
    /** 变更原因 */
    private String changeReason;
    /** 变更接收时间 */
    private Date changeRecTime;
    /** 最后变更记录ID */
    private Integer changeId;
    /** 计划单ID */
    private Integer sheetId;
    /** 计划员 */
    private String rppPlanner;
    /** 数据类型 */
    private String dataType;
    /** 数据类型 */
    private Integer useStock;
    /** 提报计划主键 */
    private Integer rppId;

    private String rppMatDesc;

    private String rppMatCode;

    private Double rppNum;

    private Double rppRealNum;

    private Double rppOverNum;

    private String rppUnit;

    private String rppStandardNo;

    private String rppProjectName;

    private String rppProjectCode;

    private String rppBrand;

    private String rppRemark;

    private String rppPart;

    private String rppDesigner;

    private Date rppCreateTime;

    private String rppCreateUser;

    private Integer rppOriginalFlag;

    private Integer rppSppId;

    private Integer rppStatus;

    private Integer rppSrcId;

    private Integer rppAllowCancel;

    private Integer rppUseStock;

    private Integer rppTypeId;

    private String rppTypes;

    private Integer rppStockId;

    private Integer rppSubFlag;

    private String rppPlanNo;

    private String rppItyType;

    private String rppChange;

    private Integer rppIsFlag;

    private Integer rppAppend;

    private Integer rppOdaId;

    private Integer rppRetStatus;

    private Integer rppAppendId;

    private Integer rppChangeMark;

    private Date rppDelTime;

    private String rppAssignDesc;

    private String rppProduceCode;

    private Date rppEditTime;

    private Date rppCommitTime;

    private String rppDelReason;

    private String rppPlannerRemark;

    private Integer rppUseStore;
    private String rppUseStoreStr;

    private String rppAssistType;

    private String rppDesignerTel;

    private String rppDesignerDept;

    private String rppMalType;

    private Integer rppResultId;

    private String rppDiagram;

    private Integer rppPostPlannerStatus;

    private Integer rppEditFlag;

    private String rppExtendUrl;

    private Date rppRecTime;

    private Date rppChangeTime;

    private Integer rppAncestorsId;

    private String displayNum;

    private String rppSplitPlanType;

    /**
     * 变更创建时间：用来列表显示
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date changeCreateTime;
    /**
     * 变更创建时间：用来区间查询开始时间
     * */
    private Date changeCreateTimeStart;
    /**
     * 变更创建时间：用来区间查询结束时间
     * */
    private Date changeCreateTimeEnd;

    public void setChangeCreateTimeEnd(Date changeCreateTimeEnd) {
        if (changeCreateTimeEnd != null) {
            Calendar cal = Calendar.getInstance();
            cal.setTime(changeCreateTimeEnd);
            cal.add(Calendar.DAY_OF_YEAR, +1);
            this.changeCreateTimeEnd = cal.getTime();
        } else {
            this.changeCreateTimeEnd = null;
        }
    }
}
